/*
 * $Id$
 */
package py.firefly;

import py.firefly.resolution.Forward;
import py.firefly.resolution.Resolution;

/**
 *
 * @author py
 */
public abstract class Validator extends Before {

    private String _input;

    /**
     * 
     * @return 
     */
    @Override
    public final Resolution before() {
        return isValid() ? null : new Forward(_input);
    }
    
    /**
     * 
     * @return 
     */
    public abstract boolean isValid();

    /**
     * 
     * @param input
     * @return 
     */
    public Validator input(final String input) {
        _input = input;
        return this;
    }
}
